import Vuex from 'vuex'

export default Vuex.createStore({
  state: {
    navIndex: 0,
    consName: '头条',
    type: 'top',
    errorCode: 0,
    data: {},
    isShowBack:false,

  },
  mutations: {
    setType (store,type){
      store.type = type
    },
    setNavIndex (state, index) {
      state.navIndex = index;
        },
   setConsName (state, constName){
       state.consName = constName
   },
   
    setErrorCode (state,errorCode){
      state.errorCode = errorCode
   },
    setData (state,data){
      state.data = data
    },


  },

});
